home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1990-06-14 | 1.6 KB | 44 lines | [TEXT/PMED] |
- DEFINITION MODULE Loader;
- (* overlay loader for the Modula system *)
- (* P. Fink, ETH / fixed by Tim Myers November 1986 *)
-
- FROM SYSTEM IMPORT ADDRESS;
- EXPORT QUALIFIED Call, Load, Unload;
-
- PROCEDURE Call(VAR OvName: ARRAY OF CHAR; VAR result : INTEGER);
- (* load and execute overlay OvName, as a subroutine *)
- (* OvName must be a file name, possibly prefixed with a volume name.
- volume handling:
- no volume -- overlay is on the default volume
- volume -- overlay is on the specified volume
- '*:' -- search overlay on all the drives, highest driv num first.
-
- Done if: loading, and possibly execution, are errorfree.
- default extension for the load file search will be .LOD
- result is zero, when everything was ok, otherwise an error number
- (system-dependent) *)
-
-
- (* more sophisticated functions: (not yet implemented) *)
- (* definitely not required for the compiler ! *)
- (* INTENDED FOR:
- management of several independent loaded modules.
- useful in M3 for the O.S., on the SMAKY 8 for XS-1.
- consistency is important. it is an error to load when the
- base layer is not loaded, or to unload when overlays are
- still loaded.
- The identification of the base layer for an overlay is
- done at link time.
- specs written by me (PF) *)
-
- PROCEDURE Load (VAR ovname : ARRAY OF CHAR; VAR reference: ADDRESS;
- VAR error : INTEGER);
- (* load overlay ovname into memory, and execute its initialization part.
- does not unload it. code and data remain in memory *)
-
- PROCEDURE Unload (reference: ADDRESS; VAR error: INTEGER);
- (* unload the referenced overlay *)
-
- END Loader.
-
-